﻿using System;
using System.Collections.Generic;
using System.IO;

class SortNames
{
    static void Main()
    {
        using (StreamReader input = new StreamReader("input.txt"))
        {
            string currentLine;
            List<string> listOfNames = new List<string>();

            while ((currentLine = input.ReadLine()) != null)
            {
                listOfNames.Add(currentLine);
            }

            listOfNames.Sort();

            using (StreamWriter output = new StreamWriter("output.txt"))
            {
                for (int i = 0; i < listOfNames.Count; i++)
                {
                    output.WriteLine(listOfNames[i]);
                }
            }
        }
    }
}